package com.hw.service.order;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hw.entity.dto.order.OrderDTO;
import com.hw.entity.dto.order.OrderHistoryDTO;
import com.hw.entity.dto.shoppingCart.ShoppingCartDTO;
import com.hw.entity.po.basic.StoreInfo;
import com.hw.entity.po.order.Order;
import com.hw.entity.query.order.HistoryOrderQuery;
import com.hw.entity.query.order.OrderQuery;
import com.hw.entity.vo.order.HistoryOrderVO;
import com.hw.entity.vo.order.OrderListVO;
import com.hw.entity.vo.order.OrderVO;
import com.hw.model.ResponseResult;

import java.util.List;

/**
 * 订单表 Service
 *
 * @author xuguang
 * @date 2021-06-28
 */
public interface OrderService extends IService<Order> {

    /**
     * 获取以菜品为单位的用户信息
     *
     * @param taskId
     * @return
     */
    List<OrderVO> getUserAndFoodByOrder(String taskId);

    /**
     * 获取当前用户的历史订单
     *
     * @param orderQuery
     * @return
     */
    IPage<OrderListVO> getList(OrderQuery orderQuery);

    /**
     * 生成订单
     *
     * @param orderDTOS
     * @return
     */
    ResponseResult<?> saveOrder(List<OrderDTO> orderDTOS);

    /**
     * 获取历史点餐详情
     *
     * @param historyOrderQuery
     * @return
     */
    List<HistoryOrderVO> getHistoryInfo(HistoryOrderQuery historyOrderQuery);

    /**
     * 获取当前用户当前订单id的总价格
     *
     * @param taskId
     * @return
     */
    Double getTotalPrice(String taskId);

    /**
     * 获取当前用户当前订单id的菜品总数量
     *
     * @param taskId
     * @return
     */
    Integer getTotalNumber(String taskId);

    /**
     * 保存历史详情更改
     *
     * @param orderHistoryDTOS
     * @return
     */
    ResponseResult<?> saveHistoryChange(List<OrderHistoryDTO> orderHistoryDTOS);

}
